package Traductor.sintactico.utils;


public class ExprCampo {
	
	private ExprTipo tipo;
	private int desp;
	private String id;
	private int tam;
	private boolean error;
	private Pendientes pendientes;
	
	public boolean isError() {
		return error;
	}
	public void setError(boolean error) {
		this.error = error;
	}
	public int getTam() {
		return tam;
	}
	public void setTam(int tam) {
		this.tam = tam;
	}
	public ExprCampo(String id,ExprTipo tipo, int tam, int desp, boolean error, Pendientes p) {
		super();
		this.tipo = tipo;
		this.desp = desp;
		this.id = id;
		this.tam = tam;
		this.error = error;
		this.pendientes = p;
	}
	public ExprTipo getTipo() {
		return tipo;
	}
	public void setTipo(ExprTipo tipo) {
		this.tipo = tipo;
	}
	public int getDesp() {
		return desp;
	}
	public void setDesp(int desp) {
		this.desp = desp;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public Pendientes getPendientes() {
		return pendientes;
	}
	public void setPendientes(Pendientes pendientes) {
		this.pendientes = pendientes;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + desp;
		result = prime * result + (error ? 1231 : 1237);
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result
				+ ((pendientes == null) ? 0 : pendientes.hashCode());
		result = prime * result + tam;
		result = prime * result + ((tipo == null) ? 0 : tipo.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ExprCampo other = (ExprCampo) obj;
		if (desp != other.desp)
			return false;
		if (error != other.error)
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} /*else if (!id.equals(other.id))
			return false;*/
		if (pendientes == null) {
			if (other.pendientes != null)
				return false;
		} else if (!pendientes.equals(other.pendientes))
			return false;
		if (tam != other.tam)
			return false;
		if (tipo == null) {
			if (other.tipo != null)
				return false;
		} else if (!tipo.equals(other.tipo))
			return false;
		return true;
	}
	
	
}
